package com.turtle3d.user.grammars;

import com.turtle3d.formallanguage.grammar.Grammar;
import com.turtle3d.formallanguage.grammar.parser.SimpleParser;
import com.turtle3d.formallanguage.symbol.Symbol;

public class SierpinskiTriangle extends Grammar
{

	@Override
	public void define()
	{
		/**
		 * #Sierpinski{
			axiom X;
			angle 60;
			F: FF;
			X: --FXF++FXF++FXF--;
			}
		 */
		
		setAxiom(new Symbol("X"));
		setDefaultParameter("turnAngle", 60f);
		addProduction(SimpleParser.parseProduction("F->FF"));
		addProduction(SimpleParser.parseProduction("X->--FXF++FXF++FXF--"));

	}

}
